'''
Created on 2012-10-24

@author: jsricard
'''
import wx
class DruidTip(wx.PopupWindow):
    def __init__(self,parent):
        wx.PopupWindow.__init__(self,parent)
        self.pnl = wx.Panel(self)
        self.pnl.SetBackgroundColour("#d9eac9")
        self.st=None
        
    def setText(self,text):
        if self.st:
            self.st.Destroy()
        
        self.st = wx.StaticText(self.pnl, -1,text, pos=(10,10))
        sz = self.st.GetBestSize()
        self.SetSize( (sz.width+20, sz.height+20))
        self.pnl.SetSize( (sz.width+20, sz.height+20))